package inheritance;


class Animal{
    public void eat(){
        System.out.println("e a t");
    }
}

class Cat extends Animal{

    public void speak(){
        System.out.println(" m m ");
    }

    public static void main(String[] args) {
        Animal cat = new Cat();
        //父类声明的对象也只能调用父类的方法
//        cat.speak();
        Cat cat1 = new Cat();
        cat1.speak();

    }
}
